<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="/assets/images/favicon.ico" rel="icon">
    <title>商城后台</title>
    <link rel="stylesheet" href="/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="/assets/module/admin.css?v=315"/>
    <link rel="stylesheet" type="text/css" href="/assets/css/custom-nav.css"/>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <cite>&nbsp;商城后台管理系统</cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item" lay-unselect>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="note" title="便签"><i class="layui-icon layui-icon-note"></i></a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <img th:src="${user.avatar}" class="layui-nav-img">
                    <cite th:text="${user.username}"></cite>
                </a>
                <dl class="layui-nav-child">
                    <dd lay-unselect>
                        <a ew-href="/userProfile">个人中心</a>
                    </dd>
                    <dd lay-unselect>
                        <a ew-event="psw">修改密码</a>
                    </dd>
                    <hr>
                    <dd lay-unselect>
                        <a ew-event="logout" data-url="/logout">退出</a>
                    </dd>
                </dl>
            </li>
        </ul>
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-accordion="true"
                style="margin-top: 15px;">
                <shiro:hasPermission name="admin_system:view">
                    <li class="layui-nav-item">
                        <a><i class="layui-icon layui-icon-set"></i>&emsp;<cite>系统监控</cite></a>
                        <dl class="layui-nav-child">

                            <shiro:hasPermission name="log:view">
                                <dd><a lay-href="/system-log">系统日志</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="log:view">
                                <dd><a class="noPermission">系统日志</a></dd>
                            </shiro:lacksPermission>

                            <shiro:hasPermission name="login_log:view">
                                <dd><a lay-href="/login-log">登录日志</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="login_log:view">
                                <dd><a class="noPermission">登录日志</a></dd>
                            </shiro:lacksPermission>

                            <shiro:hasPermission name="online:view">
                                <dd><a lay-href="/online">在线用户</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="online:view">
                                <dd><a class="noPermission">在线用户</a></dd>
                            </shiro:lacksPermission>
                        </dl>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="admin_item:view">
                    <li class="layui-nav-item">
                        <a><i class="layui-icon layui-icon-cart-simple"></i>&emsp;<cite>商品管理</cite></a>
                        <dl class="layui-nav-child">
                            <shiro:hasPermission name="item:view">
                                <dd><a lay-href="/item">商品列表</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="item:view">
                                <dd><a class="noPermission">商品列表</a></dd>
                            </shiro:lacksPermission>
                            <shiro:hasPermission name="item:add">
                                <dd><a lay-href="/additem">添加商品</a></dd>
                            </shiro:hasPermission>
                        </dl>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="admin_order:view">
                    <li class="layui-nav-item">
                        <a><i class="layui-icon layui-icon-rmb"></i>&emsp;<cite>订单管理</cite></a>
                        <dl class="layui-nav-child">
                            <shiro:hasPermission name="order:view">
                                <dd><a lay-href="/order">订单列表</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="order:view">
                                <dd><a class="noPermission">订单列表</a></dd>
                            </shiro:lacksPermission>
                        </dl>
                    </li>
                </shiro:hasPermission>
                <shiro:hasPermission name="admin_user_view">
                    <li class="layui-nav-item">
                        <a><i class="layui-icon layui-icon-user"></i>&emsp;<cite>用户管理</cite></a>
                        <dl class="layui-nav-child">
                            <shiro:hasPermission name="user:view">
                                <dd><a lay-href="/user">前台用户</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="user:view">
                                <dd><a class="noPermission">前台用户</a></dd>
                            </shiro:lacksPermission>

                            <shiro:hasPermission name="admin:view">
                                <dd><a lay-href="/admin">后台用户</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="admin:view">
                                <dd><a class="noPermission">后台用户</a></dd>
                            </shiro:lacksPermission>

                            <shiro:hasPermission name="role:view">
                                <dd><a lay-href="/role">角色管理</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="role:view">
                                <dd><a class="noPermission">角色管理</a></dd>
                            </shiro:lacksPermission>
                        </dl>
                    </li>
                </shiro:hasPermission>

                <shiro:hasPermission name="portal:portal">
                    <li class="layui-nav-item">
                        <a><i class="layui-icon layui-icon-user"></i>&emsp;<cite>首页管理</cite></a>
                        <dl class="layui-nav-child">
                            <shiro:hasPermission name="ad:big">
                                <dd><a lay-href="/bigad">大广告位</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="ad:big">
                                <dd><a class="noPermission">大广告位</a></dd>
                            </shiro:lacksPermission>

                            <shiro:hasPermission name="ad:small">
                                <dd><a lay-href="/smallad">小广告位</a></dd>
                            </shiro:hasPermission>
                            <shiro:lacksPermission name="ad:small">
                                <dd><a class="noPermission">小广告位</a></dd>
                            </shiro:lacksPermission>
                        </dl>
                    </li>
                </shiro:hasPermission>


            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>
    <!-- 底部 -->
    <div class="layui-footer">
        作者：Lbaci QQ：344805353@qq.com
        <a href="www.baidu.com" target="_blank" class=pull-right>@Lbaci2020</a>
    </div>
</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/assets/js/common.js?v=315"></script>
<script>
    layui.use(['index','admin','notice','form'], function () {
        var $ = layui.jquery;
        var index = layui.index;
        var admin = layui.admin;
        var form = layui.form;
        var notice = layui.notice;

        $(".noPermission").click(function () {
            notice.msg('抱歉您没有权限访问',{icon:2,timeout:2000,animateInside:true,audio:'1'});
        });
        admin.changeTheme('theme-white');
        // 默认加载主页
        index.loadHome({
            menuPath: '/welcome',
            menuName: '<i class="layui-icon layui-icon-home"></i>'
        });

    });
</script>
</body>
</html>